package com.cancer.controller.hotel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cancer.biz.hotel.entity.query.RequsetHotelListParam;
import com.cancer.biz.hotel.entity.query.ResponseHotelDetailBody;
import com.cancer.biz.hotel.entity.query.ResponseHotelListBean;
import com.cancer.biz.hotel.service.HotelService;
import com.cancer.common.util.CommonUtil;
import com.cancer.common.web.APIModel;
import com.cancer.common.web.PageBean;

/**
 * 酒店信息相关
 * @author baizhaoming
 *
 */
@Controller
@RequestMapping("/api_v1/hotel")
public class HotelController {
    @Autowired 
    private HotelService hotelService;
    /**
     * 查询酒店列表信息（分页）
     * @return
     */
    @RequestMapping(value = "/hotelList", method = {RequestMethod.GET })
    @ResponseBody
    public Object hotelList(RequsetHotelListParam requsetHotelListParam){
        APIModel model=new APIModel();
        PageBean<ResponseHotelListBean> list=hotelService.hotelList(requsetHotelListParam);
        model.set(CommonUtil.RETURN_CODE_ZERO, CommonUtil.RETURN_MSG_SUCCESS, list);
        return model;
    }
    /**
     * 查询酒店列表信息
     * @return
     */
    @RequestMapping(value = "/selectHotelDetailById", method = {RequestMethod.GET })
    @ResponseBody
    public Object selectHotelDetailById(Long id){
        APIModel model=new APIModel();
        ResponseHotelDetailBody responseHotelDetailBody=hotelService.selectHotelDetailById(id);
        model.set(CommonUtil.RETURN_CODE_ZERO, CommonUtil.RETURN_MSG_SUCCESS, responseHotelDetailBody);
        return model;
    }
}
